package comm.qf.springmvc.mapper;

import comm.qf.springmvc.pojo.User;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UserMapper {

    User findUserById(long id);

    User findUserBuNameAndPassword(@Param("username") String username, @Param("password") String password);

    User findUserByEmailAndPhone(@Param("email") String email, @Param("phonenum") String phonenum);

    User findUserByEmailAndPhoneWhere(@Param("email") String email, @Param("phonenum") String phonenum);

    int updateUserById(User user);

    int updateUserByIdwithSet(User user);

    int updateUserState(@Param("username") String username, @Param("state") Integer state,@Param("targetState")  Integer targetState);


    List<User> findUsersByIdIn(@Param("ids") List<Long> ids);

    @Select("SELECT * FROM user")
    List<User> findAllUser();
}
